home *** CD-ROM | disk | FTP | other *** search
/ Champak 120 / Vol 120.iso / games / tobby_ur.swf / scripts / DefineSprite_68_NPC_present / frame_1 / DoAction.as
Encoding:
Text File  |  2010-11-09  |  1009 b   |  58 lines

  1. function main()
  2. {
  3.    this.hitCheck();
  4. }
  5. function hitCheck()
  6. {
  7.    if(this.hitTest(_root.tobbyMC) || this.hitTest(_root.handMC))
  8.    {
  9.       this.SE_kaito.start();
  10.       _root.getPresentNum = this.presentNum;
  11.       _parent.mesClose();
  12.       this.removeMovieClip();
  13.    }
  14. }
  15. function setPnum1()
  16. {
  17.    if(_root.getHosekiCNt < 25)
  18.    {
  19.       if(_root.getHosekiCnt % 2 == 1)
  20.       {
  21.          return 7;
  22.       }
  23.       return 8;
  24.    }
  25.    if(_root.getHosekiCnt < 30)
  26.    {
  27.       return 4;
  28.    }
  29.    return 3;
  30. }
  31. function setPnum2()
  32. {
  33.    if(_root.getHosekiCnt < 55)
  34.    {
  35.       if(_root.getHosekiCnt % 2 == 1)
  36.       {
  37.          return 5;
  38.       }
  39.       return 6;
  40.    }
  41.    if(_root.getHosekiCnt < 60)
  42.    {
  43.       return 2;
  44.    }
  45.    return 1;
  46. }
  47. this.SE_kaito = new Sound(this);
  48. this.SE_kaito.attachSound("SE_kaito");
  49. if(_root.gStageNum == 4)
  50. {
  51.    this.presentNum = setPnum1();
  52. }
  53. else
  54. {
  55.    this.presentNum = setPnum2();
  56. }
  57. this.presentMC.gotoAndPlay("p" + String(this.presentNum));
  58.